﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using HandyControl.Controls;
using HandyControl.Data;
using 多协议通信平台.Common;
using 多协议通信平台.Views.Login.Components;

namespace 多协议通信平台.ViewModels.Login
{
    public partial class RegisterContentViewModel : ObservableObject
    {
        [ObservableProperty]
        private FrameworkElement mainContent = new UserRegisterView();

        [RelayCommand]
        public void ProxySet()
        {
            
        }

        [RelayCommand]
        public void ShowView(string name)
        {
            FrameworkElement frameworkElement = IocHelper.GetInstance(name);
            if(frameworkElement == null)
            {
                Growl.Error(new GrowlInfo()
                {
                    Message = "当前页面未找到",
                    WaitTime = 2
                });
                return;
            }
            MainContent = frameworkElement;
        }
    }
}
